﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RinNote.Server.Model
{
    [Table("Account")]
    public class Account
    {
        /// <summary>
        /// 账户ID
        /// </summary>
        [Column(TypeName = "char")]
        [StringLength(32)]
        public string AccountID { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [Required]
        [StringLength(40)]
        public string UserName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Required]
        [StringLength(32)]
        public string Password { get; set; }

        /// <summary>
        /// 账户角色
        /// </summary>
        [Required]
        public AccountRole Role { get; set; }

        /// <summary>
        /// 用户昵称
        /// </summary>
        [Required]
        [StringLength(40)]
        public string NickName { get; set; }

        /// <summary>
        /// EMAIL
        /// </summary>
        [StringLength(30)]
        public string Email { get; set; }

        /// <summary>
        /// 电话
        /// </summary>
        [StringLength(30)]
        public string PhoneNumber { get; set; }
    }
    /// <summary>
    /// 账户角色
    /// </summary>
    public enum AccountRole
    {
        /// <summary>
        /// 管理员
        /// </summary>
        ADMIN,
        /// <summary>
        /// 普通用户
        /// </summary>
        USER
    }
}
